<template>
  <div class="">
    <el-breadcrumb class="breadcrumb" separator="/">
      <el-breadcrumb-item
        v-for='(name,index) in matchedArr'
        :key='index'
      >
        {{ $t(`commons.${name}`)}}
      </el-breadcrumb-item>
    </el-breadcrumb>
  </div>
</template>
<script>
export default {
  data () {
    return {
      changeBarDirection: false
    }
  },
  mounted () {

  },
  computed: {
    matchedArr () {
      let temp = []
      let temps = []
      this.$route.matched.filter((item, index, self) => {
        // if(item.meta.title){
        // const title = item.meta.title
        //     temp.push(title);
        // }
        if (item.name) {
          const name = item.name
          temp.push(name)
        }
      })
      temp.filter((item, index, self) => {
        if (!temps.includes(item)) {
          temps.push(item)
        }
      })
      return temps
    }
  },
  methods: {
    handleLefeMenu () {
      this.changeBarDirection = !this.changeBarDirection
    }
  }
}
</script>
<style lang="scss" scoped>

</style>
